package edu.buct.controller;

import core.api.BaseResponse;
import edu.buct.entity.C1;
import edu.buct.service.C1Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZYM
 * @since 2023-05-04
 */
@Api(tags = "机房回路1信息")
@RestController
@RequestMapping("/macroom/c1")
public class C1Controller {
    @Resource
    private C1Service c1Service;
    @ApiOperation("查询机房回路1信息")
    @GetMapping("/all")
    BaseResponse<C1> selectAll(){
        return c1Service.selectAll();
    }

    @ApiOperation("新增机房回路1信息")
    @PostMapping("/insert")
    BaseResponse insert(C1 c1){
        return c1Service.insert(c1);
    }

    @ApiOperation("根据id删除机房回路1信息")
    @ApiImplicitParam(name = "id",value = "气候id",required = true)
    @DeleteMapping("/delete/{id}")
    BaseResponse delete(@PathVariable("id") Integer id){
        return c1Service.delete(id);
    }

    @ApiOperation("根据id修改机房回路1信息")
    @PostMapping("/update")
    BaseResponse<C1> updateInfo(C1 c1){
        return c1Service.updateInfo(c1);
    }
}
